home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gimp.idb / usr / freeware / include / libgimp / gimpchainbutton.h.z / gimpchainbutton.h
Encoding:
C/C++ Source or Header  |  2002-07-08  |  2.8 KB  |  93 lines

  1. /* LIBGIMP - The GIMP Library 
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball                
  3.  *
  4.  * gimpchainbutton.h
  5.  * Copyright (C) 1999-2000 Sven Neumann <sven@gimp.org> 
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2 of the License, or (at your option) any later version.
  11.  * 
  12.  * This library is distributed in the hope that it will be useful, 
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  
  15.  * Lesser General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the
  19.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA 02111-1307, USA.
  21.  */
  22.  
  23. /* 
  24.  * This implements a widget derived from GtkTable that visualizes
  25.  * it's state with two different pixmaps showing a closed and a 
  26.  * broken chain. It's intented to be used with the GimpSizeEntry
  27.  * widget. The usage is quite similar to the one the GtkToggleButton
  28.  * provides. 
  29.  */
  30.  
  31. #ifndef __GIMP_CHAIN_BUTTON_H__
  32. #define __GIMP_CHAIN_BUTTON_H__
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif /* __cplusplus */
  37.  
  38.  
  39. #define GIMP_TYPE_CHAIN_BUTTON            (gimp_chain_button_get_type ())
  40. #define GIMP_CHAIN_BUTTON(obj)            (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHAIN_BUTTON, GimpChainButton))
  41. #define GIMP_CHAIN_BUTTON_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHAIN_BUTTON, GimpChainButtonClass))
  42. #define GIMP_IS_CHAIN_BUTTON(obj)         (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHAIN_BUTTON))
  43. #define GIMP_IS_CHAIN_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHAIN_BUTTON))
  44.  
  45. typedef struct _GimpChainButton       GimpChainButton;
  46. typedef struct _GimpChainButtonClass  GimpChainButtonClass;
  47.  
  48. typedef enum
  49. {
  50.   GIMP_CHAIN_TOP,
  51.   GIMP_CHAIN_LEFT,
  52.   GIMP_CHAIN_BOTTOM,
  53.   GIMP_CHAIN_RIGHT
  54. } GimpChainPosition;
  55.  
  56.  
  57. struct _GimpChainButton
  58. {
  59.   GtkTable           table;
  60.  
  61.   GimpChainPosition  position;
  62.   GtkWidget         *button;
  63.   GtkWidget         *line1;
  64.   GtkWidget         *line2;
  65.   GtkWidget         *pixmap;
  66.   GdkPixmap         *broken;
  67.   GdkBitmap         *broken_mask;
  68.   GdkPixmap         *chain;
  69.   GdkBitmap         *chain_mask;
  70.   gboolean           active;
  71. };
  72.  
  73. struct _GimpChainButtonClass
  74. {
  75.   GtkTableClass parent_class;
  76.  
  77.   void (* toggled)  (GimpChainButton *gcb);
  78. };
  79.  
  80.  
  81. GtkType     gimp_chain_button_get_type   (void);
  82. GtkWidget * gimp_chain_button_new        (GimpChainPosition  position);
  83. void        gimp_chain_button_set_active (GimpChainButton   *gcb,
  84.                       gboolean           is_active);
  85. gboolean    gimp_chain_button_get_active (GimpChainButton   *gcb);
  86.  
  87.  
  88. #ifdef __cplusplus
  89. }
  90. #endif /* __cplusplus */
  91.  
  92. #endif /* __CHAIN_BUTTON_H__ */
  93.